﻿


Public Class frmAssistNpcTransporter
    Private _conn As MySQL
    Private _loc As UInt32
    Private _entry As UInt32
    Private _creatureTemplate As cCreatureTemplate
    Private _creatureTemplateLoc As cLocalesCreatureTemplate
    Private _npcText As cNpcText
    Private _npcTextLoc As cLocalesNpcText
    Private _GossipMenu As cGossipMenu
    Private _GossipMenuOptions As cGossipMenuOptions
    Private _GossipMenuOption As cGossipMenuOption
    Private _GossipMenuOptionsLoc As cLocalesGossipMenuOptions
    Private _GossipMenuOptionLoc As cLocalesGossipMenuOption

    Private _SmartScripts As cSmartScripts
    Private _SmartScript As cSmartScript

    Public Sub New()

        ' Dieser Aufruf ist für den Designer erforderlich.
        InitializeComponent()

        ' Fügen Sie Initialisierungen nach dem InitializeComponent()-Aufruf hinzu.

    End Sub
    Public Sub New(conn As MySQL, Loc As UInt32)
        ' Dieser Aufruf ist für den Designer erforderlich.
        InitializeComponent()
        ' Fügen Sie Initialisierungen nach dem InitializeComponent()-Aufruf hinzu.
        _conn = conn
        _loc = Loc
    End Sub

    Private Sub NumericBoxNpcEntry_KeyPress(sender As Object, e As Windows.Forms.KeyPressEventArgs) Handles NumericBoxNpcEntry.KeyPress
        If e.KeyChar = Chr(13) Then
            _entry = NumericBoxNpcEntry.Value
            _creatureTemplate = New cCreatureTemplate(_conn, _entry)
            _creatureTemplateLoc = New cLocalesCreatureTemplate(_conn, _entry, _loc)
            _GossipMenu = New cGossipMenu(_conn, _creatureTemplate.gossip_menu_id)
            _npcText = New cNpcText(_conn, _GossipMenu.text_id)
            _npcTextLoc = New cLocalesNpcText(_conn, _GossipMenu.text_id, _loc)
            _GossipMenuOptions = New cGossipMenuOptions(_conn, _entry)
            _GossipMenuOption = _GossipMenuOptions.Item(0)
            _GossipMenuOptionsLoc = New cLocalesGossipMenuOptions(_conn, _entry, _loc)
            _GossipMenuOptionLoc = _GossipMenuOptionsLoc.Item(0)
            _SmartScripts = New cSmartScripts(_conn, _entry)
            For ij As UInt32 = 0 To _SmartScripts.Count - 1
                Stop
                Dim ss As cSmartScript ' = _SmartScripts.Item(ij)
                If _SmartScript.action_type = 62 Then
                    _SmartScript = ss
                End If
            Next
            TextBoxNpcName.Text = _creatureTemplate.name
            TextBoxNpcSubName.Text = _creatureTemplate.subname
            TextBoxNpcNameLoc.Text = _creatureTemplateLoc.name
            TextBoxNpcSubNameLoc.Text = _creatureTemplateLoc.subname
            NumericBoxGossipMenuId.Value = _GossipMenu.entry
            NumericBoxGossipTextId.Value = _GossipMenu.text_id
            TextBoxGossipText.Text = _npcText.text0_0
            TextBoxGossipTextLoc.Text = _npcTextLoc.text0_0
            NumericBoxOptionIcon.Value = _GossipMenuOption.option_icon
            TextBoxOptionText.Text = _GossipMenuOption.option_text
            TextBoxOptionTextLoc.Text = _GossipMenuOptionLoc.option_text
            Stop

        End If
    End Sub






End Class


